using System;
using System.Collections.Generic;
using System.Text;
using Tomahawk.Runtime.Serialization;
using System.Xml.Serialization;

namespace Tomahawk.Runtime.Logic
{

    /// <summary>
    /// Componentes are reusable features that can be attached to any kind of actor.
    /// All functionality you want to be shared be different types of actors, should be implemented as a XComponent.
    /// </summary>
    public abstract class XComponent : XObject, ISerializableDerivableType
    {

        #region "Ownership"

        private XActor owner;

        public XActor Owner
        {
            get { return owner; }
        }

        internal void SetOwner(XActor ownerActor)
        {
            this.owner = ownerActor;
        }

        #endregion

        #region ISerializableDerivableType Members

        /// <summary>
        /// Make possible serializable arrays of this type
        /// </summary>
        [XmlAttribute("type")]
        public string SerializableType
        {
            get { return GetType().FullName; }
            set { ; }
        }

        #endregion

    }

}
